
<!DOCTYPE html>

<html>
  
<!-- Mirrored from docs.sympy.org/latest/modules/assumptions/predicates.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:26:01 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />

    <title>Predicates &#8212; SymPy 1.9 documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/default.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/graphviz.css" />
    <link rel="stylesheet" type="text/css" href="../../_static/plot_directive.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-core.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-autocomplete.css" />
    <link rel="stylesheet" type="text/css" href="../../../../live.sympy.org/static/live-sphinx.css" />
    
    <script data-url_root="../../" id="documentation_options" src="../../_static/documentation_options.js"></script>
    <script src="../../_static/jquery.js"></script>
    <script src="../../_static/underscore.js"></script>
    <script src="../../_static/doctools.js"></script>
    <script src="../../../../live.sympy.org/static/utilities.js"></script>
    <script src="../../../../live.sympy.org/static/external/classy.js"></script>
    <script src="../../../../live.sympy.org/static/live-core.js"></script>
    <script src="../../../../live.sympy.org/static/live-autocomplete.js"></script>
    <script src="../../../../live.sympy.org/static/live-sphinx.js"></script>
    <script async="async" src="../../../../cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest8331.js?config=TeX-AMS_HTML-full"></script>
    <script type="text/x-mathjax-config">MathJax.Hub.Config({"tex2jax": {"inlineMath": [["\\(", "\\)"]], "displayMath": [["\\[", "\\]"]]}})</script>
    
    <link rel="shortcut icon" href="../../_static/sympy-notailtext-favicon.ico"/>
    <link href="predicates.html" rel="canonical" />
    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="Calculus" href="../calculus/index.html" />
    <link rel="prev" title="Refine" href="refine.html" /> 
  </head><body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../calculus/index.html" title="Calculus"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="refine.html" title="Refine"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Assumptions</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Predicates</a></li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <span class="target" id="module-sympy.assumptions.predicates"><span id="predicates"></span></span><section id="id1">
<h1>Predicates<a class="headerlink" href="#id1" title="Permalink to this headline">¶</a></h1>
<section id="common">
<h2>Common<a class="headerlink" href="#common" title="Permalink to this headline">¶</a></h2>
<section id="tautological">
<h3>Tautological<a class="headerlink" href="#tautological" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.common.IsTruePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.common.</span></span><span class="sig-name descname"><span class="pre">IsTruePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/common.py#L24-L81"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.common.IsTruePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Generic predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.is_true(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is true. This only makes
sense if <code class="docutils literal notranslate"><span class="pre">x</span></code> is a boolean object.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ask</span><span class="p">,</span> <span class="n">Q</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span><span class="p">,</span> <span class="n">y</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">is_true</span><span class="p">(</span><span class="kc">True</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p>Wrapping another applied predicate just returns the applied predicate.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span><span class="o">.</span><span class="n">is_true</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">even</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">Q.even(x)</span>
</pre></div>
</div>
<p>Wrapping binary relation classes in SymPy core returns applied binary
relational predicates.</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.core</span> <span class="kn">import</span> <span class="n">Eq</span><span class="p">,</span> <span class="n">Gt</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span><span class="o">.</span><span class="n">is_true</span><span class="p">(</span><span class="n">Eq</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span>
<span class="go">Q.eq(x, y)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Q</span><span class="o">.</span><span class="n">is_true</span><span class="p">(</span><span class="n">Gt</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="p">))</span>
<span class="go">Q.gt(x, y)</span>
</pre></div>
</div>
<p class="rubric">Notes</p>
<p>This class is designed to wrap the boolean objects so that they can
behave as if they are applied predicates. Consequently, wrapping another
applied predicate is unnecessary and thus it just returns the argument.
Also, binary relation classes in SymPy core have binary predicates to
represent themselves and thus wrapping them with <code class="docutils literal notranslate"><span class="pre">Q.is_true</span></code> converts them
to these applied predicates.</p>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: IsTrueHandler</p>
<p>Wrapper allowing to query the truth value of a boolean expression.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.common.IsTruePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">IsTrueHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.common.IsTruePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="commutative">
<h3>Commutative<a class="headerlink" href="#commutative" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.common.CommutativePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.common.</span></span><span class="sig-name descname"><span class="pre">CommutativePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/common.py#L6-L19"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.common.CommutativePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Commutative predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.commutative(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> commutes with any other
object with respect to multiplication operation.</p>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: CommutativeHandler</p>
<p>Handler for key ‘commutative’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.common.CommutativePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">CommutativeHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.common.CommutativePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
</section>
<section id="calculus">
<h2>Calculus<a class="headerlink" href="#calculus" title="Permalink to this headline">¶</a></h2>
<section id="finite">
<h3>Finite<a class="headerlink" href="#finite" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.calculus.FinitePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.calculus.</span></span><span class="sig-name descname"><span class="pre">FinitePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/calculus.py#L4-L46"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.calculus.FinitePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Finite number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.finite(x)</span></code> is true if <code class="docutils literal notranslate"><span class="pre">x</span></code> is a number but neither an infinity
nor a <code class="docutils literal notranslate"><span class="pre">NaN</span></code>. In other words, <code class="docutils literal notranslate"><span class="pre">ask(Q.finite(x))</span></code> is true for all
numerical <code class="docutils literal notranslate"><span class="pre">x</span></code> having a bounded absolute value.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">zoo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy.abc</span> <span class="kn">import</span> <span class="n">x</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="n">oo</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="o">-</span><span class="n">oo</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="n">zoo</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">positive</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">finite</span><span class="p">(</span><span class="n">S</span><span class="o">.</span><span class="n">NaN</span><span class="p">)))</span>
<span class="go">None</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: FiniteHandler</p>
<p>Handler for Q.finite. Test that an expression is bounded respect to all its variables.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r5"><span class="brackets"><a class="fn-backref" href="#id2">R5</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Finite">https://en.wikipedia.org/wiki/Finite</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.calculus.FinitePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">FiniteHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.calculus.FinitePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="infinite">
<h3>Infinite<a class="headerlink" href="#infinite" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.calculus.InfinitePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.calculus.</span></span><span class="sig-name descname"><span class="pre">InfinitePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/calculus.py#L49-L62"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.calculus.InfinitePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Infinite number predicate.</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.infinite(x)</span></code> is true iff the absolute value of <code class="docutils literal notranslate"><span class="pre">x</span></code> is
infinity.</p>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: InfiniteHandler</p>
<p>Handler for Q.infinite key.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.calculus.InfinitePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">InfiniteHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.calculus.InfinitePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
</section>
<section id="matrix">
<h2>Matrix<a class="headerlink" href="#matrix" title="Permalink to this headline">¶</a></h2>
<section id="symmetric">
<h3>Symmetric<a class="headerlink" href="#symmetric" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.SymmetricPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">SymmetricPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L39-L73"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.SymmetricPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Symmetric matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.symmetric(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a square matrix and is equal to
its transpose. Every square diagonal matrix is a symmetric matrix.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Y</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Z</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">X</span><span class="o">*</span><span class="n">Z</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">Z</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">X</span> <span class="o">+</span> <span class="n">Z</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">Z</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">symmetric</span><span class="p">(</span><span class="n">Y</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: SymmetricHandler</p>
<p>Handler for Q.symmetric.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r6"><span class="brackets"><a class="fn-backref" href="#id3">R6</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Symmetric_matrix">https://en.wikipedia.org/wiki/Symmetric_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.SymmetricPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">SymmetricHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.SymmetricPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="invertible">
<h3>Invertible<a class="headerlink" href="#invertible" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.InvertiblePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">InvertiblePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L76-L107"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.InvertiblePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Invertible matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.invertible(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is an invertible matrix.
A square matrix is called invertible only if its determinant is 0.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Y</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Z</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="o">*</span><span class="n">Y</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="o">*</span><span class="n">Z</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">Z</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">fullrank</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">Q</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: InvertibleHandler</p>
<p>Handler for Q.invertible.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r7"><span class="brackets"><a class="fn-backref" href="#id4">R7</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Invertible_matrix">https://en.wikipedia.org/wiki/Invertible_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.InvertiblePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">InvertibleHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.InvertiblePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="orthogonal">
<h3>Orthogonal<a class="headerlink" href="#orthogonal" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.OrthogonalPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">OrthogonalPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L110-L146"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.OrthogonalPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Orthogonal matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.orthogonal(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is an orthogonal matrix.
A square matrix <code class="docutils literal notranslate"><span class="pre">M</span></code> is an orthogonal matrix if it satisfies
<code class="docutils literal notranslate"><span class="pre">M^TM</span> <span class="pre">=</span> <span class="pre">MM^T</span> <span class="pre">=</span> <span class="pre">I</span></code> where <code class="docutils literal notranslate"><span class="pre">M^T</span></code> is the transpose matrix of
<code class="docutils literal notranslate"><span class="pre">M</span></code> and <code class="docutils literal notranslate"><span class="pre">I</span></code> is an identity matrix. Note that an orthogonal
matrix is necessarily invertible.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Y</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Z</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">orthogonal</span><span class="p">(</span><span class="n">Y</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">orthogonal</span><span class="p">(</span><span class="n">X</span><span class="o">*</span><span class="n">Z</span><span class="o">*</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">orthogonal</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">Q</span><span class="o">.</span><span class="n">orthogonal</span><span class="p">(</span><span class="n">Z</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">orthogonal</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">orthogonal</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: OrthogonalHandler</p>
<p>Handler for key ‘orthogonal’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r8"><span class="brackets"><a class="fn-backref" href="#id5">R8</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Orthogonal_matrix">https://en.wikipedia.org/wiki/Orthogonal_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.OrthogonalPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">OrthogonalHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.OrthogonalPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="unitary">
<h3>Unitary<a class="headerlink" href="#unitary" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.UnitaryPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">UnitaryPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L149-L182"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.UnitaryPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Unitary matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.unitary(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a unitary matrix.
Unitary matrix is an analogue to orthogonal matrix. A square
matrix <code class="docutils literal notranslate"><span class="pre">M</span></code> with complex elements is unitary if :math:<code class="docutils literal notranslate"><span class="pre">M^TM</span> <span class="pre">=</span> <span class="pre">MM^T=</span> <span class="pre">I</span></code>
where :math:<code class="docutils literal notranslate"><span class="pre">M^T</span></code> is the conjugate transpose matrix of <code class="docutils literal notranslate"><span class="pre">M</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Y</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Z</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">unitary</span><span class="p">(</span><span class="n">Y</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">unitary</span><span class="p">(</span><span class="n">X</span><span class="o">*</span><span class="n">Z</span><span class="o">*</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">unitary</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span> <span class="n">Q</span><span class="o">.</span><span class="n">unitary</span><span class="p">(</span><span class="n">Z</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">unitary</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: UnitaryHandler</p>
<p>Handler for key ‘unitary’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r9"><span class="brackets"><a class="fn-backref" href="#id6">R9</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Unitary_matrix">https://en.wikipedia.org/wiki/Unitary_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.UnitaryPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">UnitaryHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.UnitaryPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="positive-definite">
<h3>Positive Definite<a class="headerlink" href="#positive-definite" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.PositiveDefinitePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">PositiveDefinitePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L214-L247"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.PositiveDefinitePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Positive definite matrix predicate.</p>
<p class="rubric">Explanation</p>
<p>If <code class="docutils literal notranslate"><span class="pre">M</span></code> is a :math:<code class="docutils literal notranslate"><span class="pre">n</span> <span class="pre">\times</span> <span class="pre">n</span></code> symmetric real matrix, it is said
to be positive definite if <span class="math notranslate nohighlight">\(Z^TMZ\)</span> is positive for
every non-zero column vector <code class="docutils literal notranslate"><span class="pre">Z</span></code> of <code class="docutils literal notranslate"><span class="pre">n</span></code> real numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Y</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Y&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Z</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;Z&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">positive_definite</span><span class="p">(</span><span class="n">Y</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">positive_definite</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">positive_definite</span><span class="p">(</span><span class="n">X</span> <span class="o">+</span> <span class="n">Z</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">positive_definite</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span>
<span class="gp">... </span>    <span class="n">Q</span><span class="o">.</span><span class="n">positive_definite</span><span class="p">(</span><span class="n">Z</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: PositiveDefiniteHandler</p>
<p>Handler for key ‘positive_definite’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r10"><span class="brackets"><a class="fn-backref" href="#id7">R10</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Positive-definite_matrix">https://en.wikipedia.org/wiki/Positive-definite_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.PositiveDefinitePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">PositiveDefiniteHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.PositiveDefinitePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="upper-triangular">
<h3>Upper triangular<a class="headerlink" href="#upper-triangular" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.UpperTriangularPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">UpperTriangularPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L250-L276"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.UpperTriangularPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Upper triangular matrix predicate.</p>
<p class="rubric">Explanation</p>
<p>A matrix <code class="docutils literal notranslate"><span class="pre">M</span></code> is called upper triangular matrix if <span class="math notranslate nohighlight">\(M_{ij}=0\)</span>
for <span class="math notranslate nohighlight">\(i&lt;j\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">ZeroMatrix</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">upper_triangular</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">upper_triangular</span><span class="p">(</span><span class="n">ZeroMatrix</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: UpperTriangularHandler</p>
<p>Handler for key ‘upper_triangular’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r11"><span class="brackets"><a class="fn-backref" href="#id8">R11</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/UpperTriangularMatrix.html">http://mathworld.wolfram.com/UpperTriangularMatrix.html</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.UpperTriangularPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">UpperTriangularHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.UpperTriangularPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="lower-triangular">
<h3>Lower triangular<a class="headerlink" href="#lower-triangular" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.LowerTriangularPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">LowerTriangularPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L279-L305"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.LowerTriangularPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Lower triangular matrix predicate.</p>
<p class="rubric">Explanation</p>
<p>A matrix <code class="docutils literal notranslate"><span class="pre">M</span></code> is called lower triangular matrix if <span class="math notranslate nohighlight">\(a_{ij}=0\)</span>
for <span class="math notranslate nohighlight">\(i&gt;j\)</span>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">ZeroMatrix</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">lower_triangular</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">lower_triangular</span><span class="p">(</span><span class="n">ZeroMatrix</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: LowerTriangularHandler</p>
<p>Handler for key ‘lower_triangular’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r12"><span class="brackets"><a class="fn-backref" href="#id9">R12</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/LowerTriangularMatrix.html">http://mathworld.wolfram.com/LowerTriangularMatrix.html</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.LowerTriangularPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">LowerTriangularHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.LowerTriangularPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="diagonal">
<h3>Diagonal<a class="headerlink" href="#diagonal" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.DiagonalPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">DiagonalPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L308-L337"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.DiagonalPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Diagonal matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.diagonal(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a diagonal matrix. A diagonal
matrix is a matrix in which the entries outside the main diagonal
are all zero.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span><span class="p">,</span> <span class="n">ZeroMatrix</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">diagonal</span><span class="p">(</span><span class="n">ZeroMatrix</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">diagonal</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">lower_triangular</span><span class="p">(</span><span class="n">X</span><span class="p">)</span> <span class="o">&amp;</span>
<span class="gp">... </span>    <span class="n">Q</span><span class="o">.</span><span class="n">upper_triangular</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: DiagonalHandler</p>
<p>Handler for key ‘diagonal’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r13"><span class="brackets"><a class="fn-backref" href="#id10">R13</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Diagonal_matrix">https://en.wikipedia.org/wiki/Diagonal_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.DiagonalPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">DiagonalHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.DiagonalPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="full-rank">
<h3>Full rank<a class="headerlink" href="#full-rank" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.FullRankPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">FullRankPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L185-L211"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.FullRankPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Fullrank matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.fullrank(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a full rank matrix.
A matrix is full rank if all rows and columns of the matrix
are linearly independent. A square matrix is full rank iff
its determinant is nonzero.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span><span class="p">,</span> <span class="n">ZeroMatrix</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">fullrank</span><span class="p">(</span><span class="n">X</span><span class="o">.</span><span class="n">T</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">fullrank</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">fullrank</span><span class="p">(</span><span class="n">ZeroMatrix</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">)))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">fullrank</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: FullRankHandler</p>
<p>Handler for key ‘fullrank’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.FullRankPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">FullRankHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.FullRankPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="square">
<h3>Square<a class="headerlink" href="#square" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.SquarePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">SquarePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L4-L36"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.SquarePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Square matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.square(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a square matrix. A square matrix
is a matrix with the same number of rows and columns.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span><span class="p">,</span> <span class="n">ZeroMatrix</span><span class="p">,</span> <span class="n">Identity</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">Y</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">Y</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">ZeroMatrix</span><span class="p">(</span><span class="mi">3</span><span class="p">,</span> <span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">square</span><span class="p">(</span><span class="n">Identity</span><span class="p">(</span><span class="mi">3</span><span class="p">)))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: SquareHandler</p>
<p>Handler for Q.square.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r14"><span class="brackets"><a class="fn-backref" href="#id11">R14</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Square_matrix">https://en.wikipedia.org/wiki/Square_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.SquarePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">SquareHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.SquarePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="integer-elements">
<h3>Integer elements<a class="headerlink" href="#integer-elements" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.IntegerElementsPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">IntegerElementsPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L340-L360"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.IntegerElementsPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Integer elements matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.integer_elements(x)</span></code> is true iff all the elements of <code class="docutils literal notranslate"><span class="pre">x</span></code>
are integers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]),</span> <span class="n">Q</span><span class="o">.</span><span class="n">integer_elements</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: IntegerElementsHandler</p>
<p>Handler for key ‘integer_elements’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.IntegerElementsPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">IntegerElementsHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.IntegerElementsPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="real-elements">
<h3>Real elements<a class="headerlink" href="#real-elements" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.RealElementsPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">RealElementsPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L363-L383"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.RealElementsPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Real elements matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.real_elements(x)</span></code> is true iff all the elements of <code class="docutils literal notranslate"><span class="pre">x</span></code>
are real numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]),</span> <span class="n">Q</span><span class="o">.</span><span class="n">real_elements</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: RealElementsHandler</p>
<p>Handler for key ‘real_elements’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.RealElementsPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">RealElementsHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.RealElementsPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="complex-elements">
<h3>Complex elements<a class="headerlink" href="#complex-elements" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.ComplexElementsPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">ComplexElementsPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L386-L408"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.ComplexElementsPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Complex elements matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.complex_elements(x)</span></code> is true iff all the elements of <code class="docutils literal notranslate"><span class="pre">x</span></code>
are complex numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">complex</span><span class="p">(</span><span class="n">X</span><span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">]),</span> <span class="n">Q</span><span class="o">.</span><span class="n">complex_elements</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">complex_elements</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">integer_elements</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: ComplexElementsHandler</p>
<p>Handler for key ‘complex_elements’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.ComplexElementsPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">ComplexElementsHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.ComplexElementsPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="singular">
<h3>Singular<a class="headerlink" href="#singular" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.SingularPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">SingularPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L411-L434"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.SingularPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Singular matrix predicate.</p>
<p>A matrix is singular iff the value of its determinant is 0.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">singular</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">singular</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="o">~</span><span class="n">Q</span><span class="o">.</span><span class="n">invertible</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: SingularHandler</p>
<p>Predicate fore key ‘singular’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r15"><span class="brackets"><a class="fn-backref" href="#id12">R15</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/SingularMatrix.html">http://mathworld.wolfram.com/SingularMatrix.html</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.SingularPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">SingularHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.SingularPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="normal">
<h3>Normal<a class="headerlink" href="#normal" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.NormalPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">NormalPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L437-L458"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.NormalPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Normal matrix predicate.</p>
<p>A matrix is normal if it commutes with its conjugate transpose.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">normal</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">unitary</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: NormalHandler</p>
<p>Predicate fore key ‘normal’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r16"><span class="brackets"><a class="fn-backref" href="#id13">R16</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Normal_matrix">https://en.wikipedia.org/wiki/Normal_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.NormalPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">NormalHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.NormalPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="triangular">
<h3>Triangular<a class="headerlink" href="#triangular" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.TriangularPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">TriangularPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L461-L488"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.TriangularPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Triangular matrix predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.triangular(X)</span></code> is true if <code class="docutils literal notranslate"><span class="pre">X</span></code> is one that is either lower
triangular or upper triangular.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">triangular</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">upper_triangular</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">triangular</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">lower_triangular</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: TriangularHandler</p>
<p>Predicate fore key ‘triangular’.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r17"><span class="brackets"><a class="fn-backref" href="#id14">R17</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Triangular_matrix">https://en.wikipedia.org/wiki/Triangular_matrix</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.TriangularPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">TriangularHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.TriangularPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="unit-triangular">
<h3>Unit triangular<a class="headerlink" href="#unit-triangular" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.UnitTriangularPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.matrices.</span></span><span class="sig-name descname"><span class="pre">UnitTriangularPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/matrices.py#L491-L511"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.matrices.UnitTriangularPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Unit triangular matrix predicate.</p>
<p class="rubric">Explanation</p>
<p>A unit triangular matrix is a triangular matrix with 1s
on the diagonal.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">MatrixSymbol</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">X</span> <span class="o">=</span> <span class="n">MatrixSymbol</span><span class="p">(</span><span class="s1">&#39;X&#39;</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">4</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">triangular</span><span class="p">(</span><span class="n">X</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">unit_triangular</span><span class="p">(</span><span class="n">X</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: UnitTriangularHandler</p>
<p>Predicate fore key ‘unit_triangular’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.matrices.UnitTriangularPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">UnitTriangularHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.matrices.UnitTriangularPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
</section>
<section id="number-theory">
<h2>Number Theory<a class="headerlink" href="#number-theory" title="Permalink to this headline">¶</a></h2>
<section id="even">
<h3>Even<a class="headerlink" href="#even" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.EvenPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.ntheory.</span></span><span class="sig-name descname"><span class="pre">EvenPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/ntheory.py#L70-L95"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.EvenPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Even number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.even(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of even
integers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">even</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">even</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">even</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">even</span><span class="p">(</span><span class="n">pi</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: EvenHandler</p>
<p>Handler for key ‘even’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.EvenPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">EvenHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.EvenPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="odd">
<h3>Odd<a class="headerlink" href="#odd" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.OddPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.ntheory.</span></span><span class="sig-name descname"><span class="pre">OddPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/ntheory.py#L98-L126"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.OddPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Odd number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.odd(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of odd numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">odd</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">odd</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">odd</span><span class="p">(</span><span class="mi">3</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">odd</span><span class="p">(</span><span class="n">pi</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: OddHandler</p>
<p>Handler for key ‘odd’. Test that an expression represents an odd number.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.OddPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">OddHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.OddPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="prime">
<h3>Prime<a class="headerlink" href="#prime" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.PrimePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.ntheory.</span></span><span class="sig-name descname"><span class="pre">PrimePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/ntheory.py#L5-L39"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.PrimePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Prime number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.prime(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a natural number greater
than 1 that has no positive divisors other than <code class="docutils literal notranslate"><span class="pre">1</span></code> and the
number itself.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">prime</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">prime</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">prime</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">prime</span><span class="p">(</span><span class="mi">20</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">prime</span><span class="p">(</span><span class="o">-</span><span class="mi">3</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: PrimeHandler</p>
<p>Handler for key ‘prime’. Test that an expression represents a prime number. When the expression is an exact number, the result (when True) is subject to the limitations of isprime() which is used to return the result.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.PrimePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">PrimeHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.PrimePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="composite">
<h3>Composite<a class="headerlink" href="#composite" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.CompositePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.ntheory.</span></span><span class="sig-name descname"><span class="pre">CompositePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/ntheory.py#L42-L67"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.CompositePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Composite number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.composite(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a positive integer and has
at least one positive divisor other than <code class="docutils literal notranslate"><span class="pre">1</span></code> and the number itself.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">composite</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">composite</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">composite</span><span class="p">(</span><span class="mi">2</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">composite</span><span class="p">(</span><span class="mi">20</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: CompositeHandler</p>
<p>Handler for key ‘composite’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.ntheory.CompositePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">CompositeHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.ntheory.CompositePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
</section>
<section id="order">
<h2>Order<a class="headerlink" href="#order" title="Permalink to this headline">¶</a></h2>
<section id="positive">
<h3>Positive<a class="headerlink" href="#positive" title="Permalink to this headline">¶</a></h3>
<dl class="simple">
<dt>… autoclass:: sympy.assumptions.predicates.order.PositivePredicate</dt><dd><dl class="field-list simple">
<dt class="field-odd">members</dt>
<dd class="field-odd"><p></p></dd>
</dl>
</dd>
</dl>
</section>
<section id="negative">
<h3>Negative<a class="headerlink" href="#negative" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NegativePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.order.</span></span><span class="sig-name descname"><span class="pre">NegativePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/order.py#L5-L48"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.order.NegativePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Negative number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.negative(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a real number and <span class="math notranslate nohighlight">\(x &lt; 0\)</span>, that is,
it is in the interval <span class="math notranslate nohighlight">\((-\infty, 0)\)</span>.  Note in particular that negative
infinity is not negative.</p>
<p>A few important facts about negative numbers:</p>
<ul class="simple">
<li><dl class="simple">
<dt>Note that <code class="docutils literal notranslate"><span class="pre">Q.nonnegative</span></code> and <code class="docutils literal notranslate"><span class="pre">~Q.negative</span></code> are <em>not</em> the same</dt><dd><p>thing. <code class="docutils literal notranslate"><span class="pre">~Q.negative(x)</span></code> simply means that <code class="docutils literal notranslate"><span class="pre">x</span></code> is not negative,
whereas <code class="docutils literal notranslate"><span class="pre">Q.nonnegative(x)</span></code> means that <code class="docutils literal notranslate"><span class="pre">x</span></code> is real and not
negative, i.e., <code class="docutils literal notranslate"><span class="pre">Q.nonnegative(x)</span></code> is logically equivalent to
<code class="docutils literal notranslate"><span class="pre">Q.zero(x)</span> <span class="pre">|</span> <span class="pre">Q.positive(x)</span></code>.  So for example, <code class="docutils literal notranslate"><span class="pre">~Q.negative(I)</span></code> is
true, whereas <code class="docutils literal notranslate"><span class="pre">Q.nonnegative(I)</span></code> is false.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>See the documentation of <code class="docutils literal notranslate"><span class="pre">Q.real</span></code> for more information about</dt><dd><p>related facts.</p>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">negative</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&amp;</span> <span class="o">~</span><span class="n">Q</span><span class="o">.</span><span class="n">positive</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">&amp;</span> <span class="o">~</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">negative</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonnegative</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="o">~</span><span class="n">Q</span><span class="o">.</span><span class="n">negative</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: NegativeHandler</p>
<p>Handler for Q.negative. Test that an expression is strictly less than zero.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NegativePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">NegativeHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.order.NegativePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="zero">
<h3>Zero<a class="headerlink" href="#zero" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.ZeroPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.order.</span></span><span class="sig-name descname"><span class="pre">ZeroPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/order.py#L139-L169"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.order.ZeroPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Zero number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.zero(x))</span></code> is true iff the value of <code class="docutils literal notranslate"><span class="pre">x</span></code> is zero.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ask</span><span class="p">,</span> <span class="n">Q</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x, y&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="mi">1</span><span class="o">/</span><span class="n">oo</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="mi">0</span><span class="o">*</span><span class="n">oo</span><span class="p">)))</span>
<span class="go">None</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">x</span><span class="o">*</span><span class="n">y</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="o">|</span> <span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">y</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: ZeroHandler</p>
<p>Handler for key ‘zero’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.ZeroPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">ZeroHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.order.ZeroPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="nonzero">
<h3>Nonzero<a class="headerlink" href="#nonzero" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NonZeroPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.order.</span></span><span class="sig-name descname"><span class="pre">NonZeroPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/order.py#L91-L136"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.order.NonZeroPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Nonzero real number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.nonzero(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is real and <code class="docutils literal notranslate"><span class="pre">x</span></code> is not zero.  Note in
particular that <code class="docutils literal notranslate"><span class="pre">Q.nonzero(x)</span></code> is false if <code class="docutils literal notranslate"><span class="pre">x</span></code> is not real.  Use
<code class="docutils literal notranslate"><span class="pre">~Q.zero(x)</span></code> if you want the negation of being zero without any real
assumptions.</p>
<p>A few important facts about nonzero numbers:</p>
<ul class="simple">
<li><p><code class="docutils literal notranslate"><span class="pre">Q.nonzero</span></code> is logically equivalent to <code class="docutils literal notranslate"><span class="pre">Q.positive</span> <span class="pre">|</span> <span class="pre">Q.negative</span></code>.</p></li>
<li><dl class="simple">
<dt>See the documentation of <code class="docutils literal notranslate"><span class="pre">Q.real</span></code> for more information about</dt><dd><p>related facts.</p>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">symbols</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="nb">print</span><span class="p">(</span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonzero</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="o">~</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">x</span><span class="p">)))</span>
<span class="go">None</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonzero</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">positive</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonzero</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonzero</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonzero</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="o">~</span><span class="n">Q</span><span class="o">.</span><span class="n">zero</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonzero</span><span class="p">(</span><span class="n">oo</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: NonZeroHandler</p>
<p>Handler for key ‘zero’. Test that an expression is not identically zero.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NonZeroPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">NonZeroHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.order.NonZeroPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="nonpositive">
<h3>Nonpositive<a class="headerlink" href="#nonpositive" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NonPositivePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.order.</span></span><span class="sig-name descname"><span class="pre">NonPositivePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/order.py#L172-L210"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.order.NonPositivePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Nonpositive real number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.nonpositive(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of
negative numbers including zero.</p>
<ul class="simple">
<li><dl class="simple">
<dt>Note that <code class="docutils literal notranslate"><span class="pre">Q.nonpositive</span></code> and <code class="docutils literal notranslate"><span class="pre">~Q.positive</span></code> are <em>not</em> the same</dt><dd><p>thing. <code class="docutils literal notranslate"><span class="pre">~Q.positive(x)</span></code> simply means that <code class="docutils literal notranslate"><span class="pre">x</span></code> is not positive,
whereas <code class="docutils literal notranslate"><span class="pre">Q.nonpositive(x)</span></code> means that <code class="docutils literal notranslate"><span class="pre">x</span></code> is real and not
positive, i.e., <code class="docutils literal notranslate"><span class="pre">Q.nonpositive(x)</span></code> is logically equivalent to
<span class="math notranslate nohighlight">\(Q.negative(x) | Q.zero(x)\)</span>.  So for example, <code class="docutils literal notranslate"><span class="pre">~Q.positive(I)</span></code> is
true, whereas <code class="docutils literal notranslate"><span class="pre">Q.nonpositive(I)</span></code> is false.</p>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">I</span>
</pre></div>
</div>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonpositive</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonpositive</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonpositive</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonpositive</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonpositive</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: NonPositiveHandler</p>
<p>Handler for key ‘nonpositive’.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NonPositivePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">NonPositiveHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.order.NonPositivePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="nonnegative">
<h3>Nonnegative<a class="headerlink" href="#nonnegative" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NonNegativePredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.order.</span></span><span class="sig-name descname"><span class="pre">NonNegativePredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/order.py#L51-L88"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.order.NonNegativePredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Nonnegative real number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.nonnegative(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of
positive numbers including zero.</p>
<ul class="simple">
<li><dl class="simple">
<dt>Note that <code class="docutils literal notranslate"><span class="pre">Q.nonnegative</span></code> and <code class="docutils literal notranslate"><span class="pre">~Q.negative</span></code> are <em>not</em> the same</dt><dd><p>thing. <code class="docutils literal notranslate"><span class="pre">~Q.negative(x)</span></code> simply means that <code class="docutils literal notranslate"><span class="pre">x</span></code> is not negative,
whereas <code class="docutils literal notranslate"><span class="pre">Q.nonnegative(x)</span></code> means that <code class="docutils literal notranslate"><span class="pre">x</span></code> is real and not
negative, i.e., <code class="docutils literal notranslate"><span class="pre">Q.nonnegative(x)</span></code> is logically equivalent to
<code class="docutils literal notranslate"><span class="pre">Q.zero(x)</span> <span class="pre">|</span> <span class="pre">Q.positive(x)</span></code>.  So for example, <code class="docutils literal notranslate"><span class="pre">~Q.negative(I)</span></code> is
true, whereas <code class="docutils literal notranslate"><span class="pre">Q.nonnegative(I)</span></code> is false.</p>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonnegative</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonnegative</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonnegative</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonnegative</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">nonnegative</span><span class="p">(</span><span class="o">-</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: NonNegativeHandler</p>
<p>Handler for Q.nonnegative.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.order.NonNegativePredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">NonNegativeHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.order.NonNegativePredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
</section>
<section id="sets">
<h2>Sets<a class="headerlink" href="#sets" title="Permalink to this headline">¶</a></h2>
<section id="integer">
<h3>Integer<a class="headerlink" href="#integer" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.IntegerPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">IntegerPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L5-L35"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.IntegerPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Integer predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.integer(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of integer
numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="mi">5</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">integer</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: IntegerHandler</p>
<p>Handler for Q.integer.</p>
<p>Test that an expression belongs to the field of integer numbers.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r18"><span class="brackets"><a class="fn-backref" href="#id15">R18</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Integer">https://en.wikipedia.org/wiki/Integer</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.IntegerPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">IntegerHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.IntegerPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="rational">
<h3>Rational<a class="headerlink" href="#rational" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.RationalPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">RationalPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L38-L70"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.RationalPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Rational number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.rational(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of
rational numbers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ask</span><span class="p">,</span> <span class="n">Q</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">S</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">rational</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">rational</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">rational</span><span class="p">(</span><span class="n">pi</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: RationalHandler</p>
<p>Handler for Q.rational.</p>
<p>Test that an expression belongs to the field of rational numbers.</p>
<p class="rubric">References</p>
<p><a class="reference external" href="https://en.wikipedia.org/wiki/Rational_number">https://en.wikipedia.org/wiki/Rational_number</a></p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.RationalPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">RationalHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.RationalPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="irrational">
<h3>Irrational<a class="headerlink" href="#irrational" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.IrrationalPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">IrrationalPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L73-L107"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.IrrationalPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Irrational number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.irrational(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code>  is any real number that
cannot be expressed as a ratio of integers.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ask</span><span class="p">,</span> <span class="n">Q</span><span class="p">,</span> <span class="n">pi</span><span class="p">,</span> <span class="n">S</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">irrational</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">irrational</span><span class="p">(</span><span class="n">S</span><span class="p">(</span><span class="mi">1</span><span class="p">)</span><span class="o">/</span><span class="mi">2</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">irrational</span><span class="p">(</span><span class="n">pi</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">irrational</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: IrrationalHandler</p>
<p>Handler for Q.irrational.</p>
<p>Test that an expression is irrational numbers.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r19"><span class="brackets"><a class="fn-backref" href="#id16">R19</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Irrational_number">https://en.wikipedia.org/wiki/Irrational_number</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.IrrationalPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">IrrationalHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.IrrationalPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="real">
<h3>Real<a class="headerlink" href="#real" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.RealPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">RealPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L110-L173"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.RealPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Real number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.real(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a real number, i.e., it is in the
interval <span class="math notranslate nohighlight">\((-\infty, \infty)\)</span>.  Note that, in particular the
infinities are not real. Use <code class="docutils literal notranslate"><span class="pre">Q.extended_real</span></code> if you want to
consider those as well.</p>
<p>A few important facts about reals:</p>
<ul class="simple">
<li><dl class="simple">
<dt>Every real number is positive, negative, or zero.  Furthermore,</dt><dd><p>because these sets are pairwise disjoint, each real number is
exactly one of those three.</p>
</dd>
</dl>
</li>
<li><p>Every real number is also complex.</p></li>
<li><p>Every real number is finite.</p></li>
<li><p>Every real number is either rational or irrational.</p></li>
<li><p>Every real number is either algebraic or transcendental.</p></li>
<li><dl class="simple">
<dt>The facts <code class="docutils literal notranslate"><span class="pre">Q.negative</span></code>, <code class="docutils literal notranslate"><span class="pre">Q.zero</span></code>, <code class="docutils literal notranslate"><span class="pre">Q.positive</span></code>,</dt><dd><p><code class="docutils literal notranslate"><span class="pre">Q.nonnegative</span></code>, <code class="docutils literal notranslate"><span class="pre">Q.nonpositive</span></code>, <code class="docutils literal notranslate"><span class="pre">Q.nonzero</span></code>,
<code class="docutils literal notranslate"><span class="pre">Q.integer</span></code>, <code class="docutils literal notranslate"><span class="pre">Q.rational</span></code>, and <code class="docutils literal notranslate"><span class="pre">Q.irrational</span></code> all imply
<code class="docutils literal notranslate"><span class="pre">Q.real</span></code>, as do all facts that imply those facts.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>The facts <code class="docutils literal notranslate"><span class="pre">Q.algebraic</span></code>, and <code class="docutils literal notranslate"><span class="pre">Q.transcendental</span></code> do not imply</dt><dd><p><code class="docutils literal notranslate"><span class="pre">Q.real</span></code>; they imply <code class="docutils literal notranslate"><span class="pre">Q.complex</span></code>. An algebraic or
transcendental number may or may not be real.</p>
</dd>
</dl>
</li>
<li><dl class="simple">
<dt>The “non” facts (i.e., <code class="docutils literal notranslate"><span class="pre">Q.nonnegative</span></code>, <code class="docutils literal notranslate"><span class="pre">Q.nonzero</span></code>,</dt><dd><p><code class="docutils literal notranslate"><span class="pre">Q.nonpositive</span></code> and <code class="docutils literal notranslate"><span class="pre">Q.noninteger</span></code>) are not equivalent to
not the fact, but rather, not the fact <em>and</em> <code class="docutils literal notranslate"><span class="pre">Q.real</span></code>.
For example, <code class="docutils literal notranslate"><span class="pre">Q.nonnegative</span></code> means <code class="docutils literal notranslate"><span class="pre">~Q.negative</span> <span class="pre">&amp;</span> <span class="pre">Q.real</span></code>.
So for example, <code class="docutils literal notranslate"><span class="pre">I</span></code> is not nonnegative, nonzero, or
nonpositive.</p>
</dd>
</dl>
</li>
</ul>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">symbols</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">symbols</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="n">x</span><span class="p">),</span> <span class="n">Q</span><span class="o">.</span><span class="n">positive</span><span class="p">(</span><span class="n">x</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">real</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: RealHandler</p>
<p>Handler for Q.real.</p>
<p>Test that an expression belongs to the field of real numbers.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r20"><span class="brackets"><a class="fn-backref" href="#id17">R20</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Real_number">https://en.wikipedia.org/wiki/Real_number</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.RealPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">RealHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.RealPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="extended-real">
<h3>Extended real<a class="headerlink" href="#extended-real" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.ExtendedRealPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">ExtendedRealPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L176-L207"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.ExtendedRealPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Extended real predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.extended_real(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> is a real number or
<span class="math notranslate nohighlight">\(\{-\infty, \infty\}\)</span>.</p>
<p>See documentation of <code class="docutils literal notranslate"><span class="pre">Q.real</span></code> for more information about related
facts.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ask</span><span class="p">,</span> <span class="n">Q</span><span class="p">,</span> <span class="n">oo</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">extended_real</span><span class="p">(</span><span class="mi">1</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">extended_real</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">extended_real</span><span class="p">(</span><span class="n">oo</span><span class="p">))</span>
<span class="go">True</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: ExtendedRealHandler</p>
<p>Handler for Q.extended_real.</p>
<p>Test that an expression belongs to the field of extended real</p>
<p>numbers, that is real numbers union {Infinity, -Infinity}.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.ExtendedRealPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">ExtendedRealHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.ExtendedRealPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="hermitian">
<h3>Hermitian<a class="headerlink" href="#hermitian" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.HermitianPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">HermitianPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L210-L232"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.HermitianPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Hermitian predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">ask(Q.hermitian(x))</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of
Hermitian operators.</p>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: HermitianHandler</p>
<p>Handler for Q.hermitian.</p>
<p>Test that an expression belongs to the field of Hermitian operators.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r21"><span class="brackets"><a class="fn-backref" href="#id18">R21</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/HermitianOperator.html">http://mathworld.wolfram.com/HermitianOperator.html</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.HermitianPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">HermitianHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.HermitianPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="complex">
<h3>Complex<a class="headerlink" href="#complex" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.ComplexPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">ComplexPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L235-L268"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.ComplexPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Complex number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.complex(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of complex
numbers. Note that every complex number is finite.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">Symbol</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">oo</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">x</span> <span class="o">=</span> <span class="n">Symbol</span><span class="p">(</span><span class="s1">&#39;x&#39;</span><span class="p">)</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">complex</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">complex</span><span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">complex</span><span class="p">(</span><span class="n">oo</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: ComplexHandler</p>
<p>Handler for Q.complex.</p>
<p>Test that an expression belongs to the field of complex numbers.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r22"><span class="brackets"><a class="fn-backref" href="#id19">R22</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Complex_number">https://en.wikipedia.org/wiki/Complex_number</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.ComplexPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">ComplexHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.ComplexPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="imaginary">
<h3>Imaginary<a class="headerlink" href="#imaginary" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.ImaginaryPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">ImaginaryPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L271-L305"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.ImaginaryPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Imaginary number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.imaginary(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> can be written as a real
number multiplied by the imaginary unit <code class="docutils literal notranslate"><span class="pre">I</span></code>. Please note that <code class="docutils literal notranslate"><span class="pre">0</span></code>
is not considered to be an imaginary number.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">Q</span><span class="p">,</span> <span class="n">ask</span><span class="p">,</span> <span class="n">I</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">imaginary</span><span class="p">(</span><span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">imaginary</span><span class="p">(</span><span class="mi">2</span> <span class="o">+</span> <span class="mi">3</span><span class="o">*</span><span class="n">I</span><span class="p">))</span>
<span class="go">False</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">imaginary</span><span class="p">(</span><span class="mi">0</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: ImaginaryHandler</p>
<p>Handler for Q.imaginary.</p>
<p>Test that an expression belongs to the field of imaginary numbers,</p>
<p>that is, numbers in the form x*I, where x is real.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r23"><span class="brackets"><a class="fn-backref" href="#id20">R23</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Imaginary_number">https://en.wikipedia.org/wiki/Imaginary_number</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.ImaginaryPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">ImaginaryHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.ImaginaryPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="antihermitian">
<h3>Antihermitian<a class="headerlink" href="#antihermitian" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.AntihermitianPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">AntihermitianPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L308-L332"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.AntihermitianPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Antihermitian predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.antihermitian(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the field of
antihermitian operators, i.e., operators in the form <code class="docutils literal notranslate"><span class="pre">x*I</span></code>, where
<code class="docutils literal notranslate"><span class="pre">x</span></code> is Hermitian.</p>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: AntiHermitianHandler</p>
<p>Handler for Q.antihermitian.</p>
<p>Test that an expression belongs to the field of anti-Hermitian</p>
<p>operators, that is, operators in the form x*I, where x is Hermitian.</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r24"><span class="brackets"><a class="fn-backref" href="#id21">R24</a></span></dt>
<dd><p><a class="reference external" href="http://mathworld.wolfram.com/HermitianOperator.html">http://mathworld.wolfram.com/HermitianOperator.html</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.AntihermitianPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">AntiHermitianHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.AntihermitianPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="algebraic">
<h3>Algebraic<a class="headerlink" href="#algebraic" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.AlgebraicPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">AlgebraicPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L335-L367"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.AlgebraicPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Algebraic number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.algebraic(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of
algebraic numbers. <code class="docutils literal notranslate"><span class="pre">x</span></code> is algebraic if there is some polynomial
in <code class="docutils literal notranslate"><span class="pre">p(x)\in</span> <span class="pre">\mathbb\{Q\}[x]</span></code> such that <code class="docutils literal notranslate"><span class="pre">p(x)</span> <span class="pre">=</span> <span class="pre">0</span></code>.</p>
<p class="rubric">Examples</p>
<div class="doctest highlight-default notranslate"><div class="highlight"><pre><span></span><span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">sympy</span> <span class="kn">import</span> <span class="n">ask</span><span class="p">,</span> <span class="n">Q</span><span class="p">,</span> <span class="n">sqrt</span><span class="p">,</span> <span class="n">I</span><span class="p">,</span> <span class="n">pi</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">algebraic</span><span class="p">(</span><span class="n">sqrt</span><span class="p">(</span><span class="mi">2</span><span class="p">)))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">algebraic</span><span class="p">(</span><span class="n">I</span><span class="p">))</span>
<span class="go">True</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">ask</span><span class="p">(</span><span class="n">Q</span><span class="o">.</span><span class="n">algebraic</span><span class="p">(</span><span class="n">pi</span><span class="p">))</span>
<span class="go">False</span>
</pre></div>
</div>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: AskAlgebraicpredicateHandler</p>
<p>Handler for key AskAlgebraicpredicateHandler</p>
<p class="rubric">References</p>
<dl class="citation">
<dt class="label" id="r25"><span class="brackets"><a class="fn-backref" href="#id22">R25</a></span></dt>
<dd><p><a class="reference external" href="https://en.wikipedia.org/wiki/Algebraic_number">https://en.wikipedia.org/wiki/Algebraic_number</a></p>
</dd>
</dl>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.AlgebraicPredicate.AlgebraicHandler">
<span class="sig-name descname"><span class="pre">AlgebraicHandler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">AlgebraicHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.AlgebraicPredicate.AlgebraicHandler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.AlgebraicPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">AskAlgebraicpredicateHandler&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.AlgebraicPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
<section id="transcendental">
<h3>Transcendental<a class="headerlink" href="#transcendental" title="Permalink to this headline">¶</a></h3>
<dl class="py class">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.TranscendentalPredicate">
<em class="property"><span class="pre">class</span> </em><span class="sig-prename descclassname"><span class="pre">sympy.assumptions.predicates.sets.</span></span><span class="sig-name descname"><span class="pre">TranscendentalPredicate</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="o"><span class="pre">*</span></span><span class="n"><span class="pre">args</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">**</span></span><span class="n"><span class="pre">kwargs</span></span></em><span class="sig-paren">)</span><a class="reference external" href="https://github.com/sympy/sympy/blob/00d6469eafdd4aac346a0b598184c15f2560dbe5/sympy/assumptions/predicates/sets.py#L370-L387"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#sympy.assumptions.predicates.sets.TranscendentalPredicate" title="Permalink to this definition">¶</a></dt>
<dd><p>Transcedental number predicate.</p>
<p class="rubric">Explanation</p>
<p><code class="docutils literal notranslate"><span class="pre">Q.transcendental(x)</span></code> is true iff <code class="docutils literal notranslate"><span class="pre">x</span></code> belongs to the set of
transcendental numbers. A transcendental number is a real
or complex number that is not algebraic.</p>
<p class="rubric">Handler</p>
<p>Multiply dispatched method: Transcendental</p>
<p>Handler for Q.transcendental key.</p>
<dl class="py attribute">
<dt class="sig sig-object py" id="sympy.assumptions.predicates.sets.TranscendentalPredicate.handler">
<span class="sig-name descname"><span class="pre">handler</span></span><em class="property"> <span class="pre">=</span> <span class="pre">&lt;dispatched</span> <span class="pre">Transcendental&gt;</span></em><a class="headerlink" href="#sympy.assumptions.predicates.sets.TranscendentalPredicate.handler" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</section>
</section>
</section>


            <div class="clearer"></div>
          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/sympylogo.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../index.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Predicates</a><ul>
<li><a class="reference internal" href="#common">Common</a><ul>
<li><a class="reference internal" href="#tautological">Tautological</a></li>
<li><a class="reference internal" href="#commutative">Commutative</a></li>
</ul>
</li>
<li><a class="reference internal" href="#calculus">Calculus</a><ul>
<li><a class="reference internal" href="#finite">Finite</a></li>
<li><a class="reference internal" href="#infinite">Infinite</a></li>
</ul>
</li>
<li><a class="reference internal" href="#matrix">Matrix</a><ul>
<li><a class="reference internal" href="#symmetric">Symmetric</a></li>
<li><a class="reference internal" href="#invertible">Invertible</a></li>
<li><a class="reference internal" href="#orthogonal">Orthogonal</a></li>
<li><a class="reference internal" href="#unitary">Unitary</a></li>
<li><a class="reference internal" href="#positive-definite">Positive Definite</a></li>
<li><a class="reference internal" href="#upper-triangular">Upper triangular</a></li>
<li><a class="reference internal" href="#lower-triangular">Lower triangular</a></li>
<li><a class="reference internal" href="#diagonal">Diagonal</a></li>
<li><a class="reference internal" href="#full-rank">Full rank</a></li>
<li><a class="reference internal" href="#square">Square</a></li>
<li><a class="reference internal" href="#integer-elements">Integer elements</a></li>
<li><a class="reference internal" href="#real-elements">Real elements</a></li>
<li><a class="reference internal" href="#complex-elements">Complex elements</a></li>
<li><a class="reference internal" href="#singular">Singular</a></li>
<li><a class="reference internal" href="#normal">Normal</a></li>
<li><a class="reference internal" href="#triangular">Triangular</a></li>
<li><a class="reference internal" href="#unit-triangular">Unit triangular</a></li>
</ul>
</li>
<li><a class="reference internal" href="#number-theory">Number Theory</a><ul>
<li><a class="reference internal" href="#even">Even</a></li>
<li><a class="reference internal" href="#odd">Odd</a></li>
<li><a class="reference internal" href="#prime">Prime</a></li>
<li><a class="reference internal" href="#composite">Composite</a></li>
</ul>
</li>
<li><a class="reference internal" href="#order">Order</a><ul>
<li><a class="reference internal" href="#positive">Positive</a></li>
<li><a class="reference internal" href="#negative">Negative</a></li>
<li><a class="reference internal" href="#zero">Zero</a></li>
<li><a class="reference internal" href="#nonzero">Nonzero</a></li>
<li><a class="reference internal" href="#nonpositive">Nonpositive</a></li>
<li><a class="reference internal" href="#nonnegative">Nonnegative</a></li>
</ul>
</li>
<li><a class="reference internal" href="#sets">Sets</a><ul>
<li><a class="reference internal" href="#integer">Integer</a></li>
<li><a class="reference internal" href="#rational">Rational</a></li>
<li><a class="reference internal" href="#irrational">Irrational</a></li>
<li><a class="reference internal" href="#real">Real</a></li>
<li><a class="reference internal" href="#extended-real">Extended real</a></li>
<li><a class="reference internal" href="#hermitian">Hermitian</a></li>
<li><a class="reference internal" href="#complex">Complex</a></li>
<li><a class="reference internal" href="#imaginary">Imaginary</a></li>
<li><a class="reference internal" href="#antihermitian">Antihermitian</a></li>
<li><a class="reference internal" href="#algebraic">Algebraic</a></li>
<li><a class="reference internal" href="#transcendental">Transcendental</a></li>
</ul>
</li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="refine.html"
                        title="previous chapter">Refine</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../calculus/index.html"
                        title="next chapter">Calculus</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/modules/assumptions/predicates.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="https://docs.sympy.org/latest/search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</div>
<script>$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../calculus/index.html" title="Calculus"
             >next</a> |</li>
        <li class="right" >
          <a href="refine.html" title="Refine"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../index.html">SymPy 1.9 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../index.html" >SymPy Modules Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Assumptions</a> &#187;</li>
        <li class="nav-item nav-item-this"><a href="#">Predicates</a></li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2021 SymPy Development Team.
      Last updated on Sep 30, 2021.
      Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.1.2.
    </div>
  </body>

<!-- Mirrored from docs.sympy.org/latest/modules/assumptions/predicates.html by HTTrack Website Copier/3.x [XR&CO'2014], Sat, 15 Jan 2022 03:26:02 GMT -->
</html>